package com.websocketdemo.demo.WebSocket.entity;

import com.alibaba.fastjson.JSONObject;

import javax.websocket.Session;

public class UserEntity {
    private String homeId;
    private String password;
    private String avatar;//头像
    private String username;

    @Override
    public String toString() {
        return "UserEntity{" +
                "homeId='" + homeId + '\'' +
                ", password='" + password + '\'' +
                ", avatar='" + avatar + '\'' +
                ", username='" + username + '\'' +
                ", session=" + session +
                ", em='" + em + '\'' +
                '}';
    }

    public String getHomeId() {
        return homeId;
    }

    public void setHomeId(String homeId) {
        this.homeId = homeId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getEm() {
        return em;
    }

    public void setEm(String em) {
        this.em = em;
    }

    private Session session;
    private String em;

    public UserEntity(String userId, String avatar, String username, String password, Session session) {
        this.homeId = userId;
        this.avatar = avatar;
        this.username = username;
        this.session = session;
        this.password = password;
    }

    public String getUserId() {
        return homeId;
    }

    public void setUserId(String userId) {
        this.homeId = userId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }





    public Session getSession() {
        return session;
    }

    public void setSession(Session session) {
        this.session = session;
    }

    public String getUserinfo(){
        JSONObject job = new JSONObject();
        job.put("userId",homeId);
        job.put("avatar",avatar);
        job.put("username",username);
        return job.toString();
    }

}
